import request from '@/common/request.js'
//自定义铃声
export function customAudio() {
	const innerAudioContext = uni.createInnerAudioContext();
	innerAudioContext.autoplay = true;
	innerAudioContext.src = 'https://admin.515f.com/static/media/tx.e3598bf6.mp3';
	innerAudioContext.onPlay(() => {
		console.log('开始播放');
	});
	innerAudioContext.onError((res) => {
		console.log(res.errMsg);
		console.log(res.errCode);
	});
	setTimeout(() => {
		innerAudioContext.destroy()
	}, 15000)
}
export function getPostTokenFn() {//防重提
	request.api.getPostToken().then(res => {
		uni.setStorageSync('csrf-token', res.csrfToken);
	})
}